#include<stdio.h>
int main()
{
	char string[20]={0};
	scanf("%s",string);
	int i=0;
	while(string[i]!='\0')
	{
		if(string[i]>='A'&&string[i]<='Z')
		{
			string[i]=string[i]+32;
		}
		else if(string[i]>='a'&&string[i]<='z')
		{
			string[i]=string[i]-32;
		}
		i++;
	}
	printf("%s",string);
	return 0;
 } 
